package com.h2cloud.ClassLoader;

import java.lang.reflect.Method;

/**
 * @Package: com.h2cloud.ClassLoader
 * @ClassName: MyTest
 * @Author: h2cloud
 * @CreateTime: 2024/4/14 1:09 上午
 * @Description:
 */
public class MyTest {
	public static void main(String[] args) throws Exception {
		MyClassLoaderParentFirst myClassLoaderParentFirst = new MyClassLoaderParentFirst();
		// 这里调的是 findClass 直接加载类文件，不是调 loadClass！！！
		// Class testAClass = myClassLoaderParentFirst.loadClass("com.h2cloud.ClassLoader.TestA");
		Class testAClass = myClassLoaderParentFirst.findClass("com.h2cloud.ClassLoader.TestA");
		Method mainMethod = testAClass.getDeclaredMethod("main", String[].class);
		mainMethod.invoke(null, new Object[]{args});
	}
}
